
import axios from './index.js'
export let get = (url, params) => {
    return new Promise((resolve, reject) => {
        axios.get(url, { params: params }).then(res => {
            resolve(res)
        }).catch(err => {
            reject(err)
        })
    })
}
export let post = (url, data) => {
    return new Promise((resolve, reject) => {
        axios.post(url, data).then(res => {
            resolve(res)
        }).catch(err => {
            reject(err)
        })
    })
}

export let del = (url, data) => {
    return new Promise((resolve, reject) => {
        axios.delete(url, data).then(res => {
            resolve(res)
        }).catch(err => {
            reject(err)
        })
    })
}

export let put = (url, data) => {
    return new Promise((resolve, reject) => {
        axios.put(url, data).then(res => {
            resolve(res)
        }).catch(err => {
            reject(err)
        })
    })
}